/*
 * @Date: 2025-08-01 10:37:32
 * @Auth: 463997479@qq.com
 * @LastEditors: 873768511@qq.com
 * @LastEditTime: 2025-11-07 17:13:24
 * @FilePath: \corpus\src\pages\Foundation\Manage\index.tsx
 */
import { PageContainer } from '@ant-design/pro-components';
import { Tabs } from 'antd';
import { useRef } from 'react';
import hooks from '../hooks/useHooks';
import Category from './Category';
import Cornerstone from './Cornerstone';
import styles from './index.less';
import Primitive from './Primitive';
import Question from './Question';
const Manage = () => {
  const { activeKey, setActiveKey } = hooks.useContainer();
  const refContent = useRef<any>();
  console.log(refContent.current);
  return (
    <>
      <PageContainer
        header={{
          title: false,
        }}
      >
        <div className={styles.wrapper}>
          <div className={styles.wrapperLeft}>
            <Category height={refContent?.current?.clientHeight} />
          </div>
          <div ref={refContent} className={styles.wrapperRight}>
            <Tabs
              onChange={(arg) => {
                setActiveKey(arg);
              }}
              type="card"
              items={[
                {
                  label: `原始语料文件`,
                  key: '11',
                },
                {
                  label: `基础语料`,
                  key: '22',
                },
                {
                  label: `问答对`,
                  key: '33',
                },
              ]}
            />
            {activeKey === '11' ? (
              <Primitive />
            ) : activeKey === '22' ? (
              <Cornerstone />
            ) : (
              <Question />
            )}
          </div>
        </div>
      </PageContainer>
    </>
  );
};
export default () => {
  return (
    <hooks.Provider>
      <Manage />
    </hooks.Provider>
  );
};
